home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 4: GNU Archives / Linux Cubed Series 4 - GNU Archives.iso / gnu / graphics.17 / graphics / graphics-0.17 / plot2tek / color.c < prev    next >
Encoding:
C/C++ Source or Header  |  1991-03-21  |  1.5 KB  |  39 lines

  1. /* libtek, a library of functions for tektronics 4010 compatible devices.
  2.    Copyright (C) 1989 Free Software Foundation, Inc.
  3.  
  4. libtek is distributed in the hope that it will be useful, but WITHOUT ANY
  5. WARRANTY.  No author or distributor accepts responsibility to anyone for the
  6. consequences of using it or for whether it serves any particular purpose or
  7. works at all, unless he says so in writing.  Refer to the GNU General Public
  8. License for full details.
  9.  
  10. Everyone is granted permission to copy, modify and redistribute libtek, but
  11. only under the conditions described in the GNU General Public License.  A copy
  12. of this license is supposed to have been given to you along with libtek so
  13. you can know your rights and responsibilities.  It should be in a file named
  14. COPYING.  Among other things, the copyright notice and this notice must be
  15. preserved on all copies.  */
  16.  
  17. /* This file is the color routine, which is an extension to the plot
  18.    library. It changes the color of the following drawing operations. */
  19.  
  20. #include "sys-defines.h"
  21. #include "libplot.h"
  22.  
  23. /* FGCOLOR_RED, FGCOLOR_GREEN and FGCOLOR_BLUE indicate the foreground
  24.    color of all plot. For each the range of intensity is from 0 to 1 so
  25.    that a value of (0,0,0) represents black and a value of (1,1,1)
  26.    indicates white. */
  27.  
  28. double fgcolor_red=0., fgcolor_green=0., fgcolor_blue=0.;
  29.  
  30. int
  31. color ( red, green, blue)
  32.      int red, green, blue;
  33. {
  34.   fgcolor_red = red / 0xffff;
  35.   fgcolor_green = green / 0xffff;
  36.   fgcolor_blue = blue / 0xffff;
  37.   return 0;
  38. }
  39.